package com.cl.blog.web.manager;

import cn.hutool.core.map.MapUtil;
import com.cl.blog.annotation.Login;
import com.cl.blog.common.Const;
import com.cl.blog.common.Result;
import com.cl.blog.entity.BMenu;
import com.cl.blog.service.BMenuService;
import net.sf.jsqlparser.expression.operators.arithmetic.Concat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @Author 付
 * @Date 2024-03-16 16:17
 * @Version 1.0
 * @description
 * @since 1.0
 */

@RestController
@RequestMapping("/admin/menu")
public class MenuController {

	@Resource
	BMenuService bMenuService;

	/**
	 * 获取菜单列表
	 * @param request
	 * @return
	 */
	@GetMapping("/list")
	@Login(issuer = Const.GRADE_ADMIN)
	public Result list(HttpServletRequest request){
		String token = request.getHeader("token");

		return Result.success(bMenuService.listMenu(token));
	}
}
